<?php

namespace App\Console\Commands;

use App\Events\CommentCommit;
use App\Events\Event;
use App\Events\OrderShipped;
use App\Model\Category;
use App\Model\Comment;
use App\Services\CategoryService;
use App\Services\CommentService;
use App\Services\PageService;
use App\Services\Util;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;
class TestCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'test';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
//        $comment = new Comment();
//        $comment->nickname = 'jinjie';
//        $comment->email = '923611217';
//        $comment->website = 'mygalgame.com';
//        $comment->remark = 'hahahahaha';
//        event(new CommentCommit($comment));
        //echo clean('hahahah');

        $commentSrv = new CommentService();
        Log::debug(json_encode($commentSrv->getComments(21)));
    }
}
